package cc.lj.internal.coupons.infrastructure.dao;

import cc.lj.internal.coupons.infrastructure.po.CapMerchantPO;
import cc.lj.internal.coupons.interfaces.dto.command.CapMerchantClearValueCommand;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface ICapMerchantMapper extends BaseMapper<CapMerchantPO>{

    /**
     * 自定义sql语句，将对应一个倍数模型的商户封顶额都清空
     * @param wrapper
     * @return
     */
    public Integer clearMartCapValue(@Param(Constants.WRAPPER) Wrapper<CapMerchantClearValueCommand> wrapper);

    /**
     * 查询一个倍数模型对应的所有商户封顶额之和
     * @param wrapper
     * @return
     */
    public Integer martValueSum(@Param(Constants.WRAPPER) Wrapper<CapMerchantPO> wrapper);
}
